home *** CD-ROM | disk | FTP | other *** search
/ Chip 2003 - Homepage / CHIP.BIN / share / htmledit / bashhtml / bashhtml.exe / %AppDir% / scripts / Image Rollover.txt < prev    next >
Encoding:
Text File  |  2003-09-01  |  1.7 KB  |  61 lines

  1. [DESCRIPTION]Inserts the current date anywhere on a page.[/DESCRIPTION]
  2.  
  3. [HEAD CODE]<SCRIPT LANGUAGE="JavaScript">
  4. <!--
  5.    function InsertDate(){
  6.      thedate = new Date();
  7.      theday = thedate.getDay();
  8.      themonth = thedate.getMonth();
  9.      theweekday= thedate.getDate();
  10.      weekday= theweekday;
  11.      theyear= thedate.getYear();
  12.      year = theyear
  13.  
  14.      if(theday == 0)
  15.              day = "Sunday"      
  16.      else if(theday == 1)
  17.            day = "Monday"
  18.      else if(theday == 2)
  19.              day = "Tuesday"   
  20.      else if(theday == 3)
  21.              day = "Wednesday"   
  22.      else if(theday == 4)
  23.              day = "Thursday"
  24.      else if(theday == 5)
  25.              day = "Friday"
  26.      else if(theday == 6)
  27.              day = "Saturday"
  28.  
  29.      if(themonth == 0)
  30.               month = "January"
  31.      else if(themonth ==1)
  32.               month = "February"
  33.      else if(themonth ==2)
  34.              month = "March"
  35.      else if(themonth ==3)
  36.             month = "April"
  37.      else if(themonth ==4)
  38.               month = "May"
  39.      else if(themonth ==5)
  40.               month = "June"
  41.      else if(themonth ==6)
  42.               month = "July"
  43.      else if(themonth ==7)
  44.             month = "August"
  45.      else if(themonth ==8)
  46.            month = "September"
  47.      else if(themonth ==9)
  48.           month = "October"
  49.      else if(themonth ==10)
  50.           month = "November"
  51.      else if(themonth ==11)
  52.           month = "December"
  53.  
  54.      document.write(day +", " +month + " ");
  55.      document.write(theweekday +", " +theyear);}
  56. -->
  57. </SCRIPT>[/HEAD CODE]
  58.  
  59. [BODY CODE]<SCRIPT LANGUAGE="JavaScript">InsertDate();</SCRIPT>[/BODY CODE]
  60.  
  61. [NOTES]Place the Body code where you want the date to be inserted.[/NOTES]